(function(w, undefined) {
  $.fn.lazyLoad = function(realUrl) {
    let totalTop = $(window).height() + $(window).scrollTop();

    this.each((i, item) => {
      if ($(item).offset().top <= totalTop) {
        item.src = item.getAttribute(realUrl);
      }
    });
  };
})(window);
